


import { observable, action } from 'mobx'
import { ajax } from '../../api'

class Card {
    @observable cardlist = []

    @action AsyncGetCartlist = (payload: any) => {
        return new Promise(async res => {
            let { code, result }: any = await ajax.getcartlist(payload)
            if (code == 200) {
                this.cardlist = result
                res(result)
            }
        })
    }

    @action changeCardlist = (payload: any) => {
        this.cardlist = payload
    }
}

export default new Card()